function diff = mean_t_fun(m,Q)

    G = (Q-Q(1))./(Q(end)-Q(1));
    g_p = G(2:end)-G(1:end-1);
    diff = g_p'*m(1:end-1);

end
    